using MicroMsg.Manager;
using MicroMsg.Resource.@string;
using MicroMsg.Storage;
using MicroMsg.UI.Util;
using System;
using System.Diagnostics;
using System.Windows;
using System.Windows.Controls;
namespace MicroMsg.UI.UserContrl
{
	public class TXBlogReadPluginSetCtrl : PluginSettingBaseCtrl
	{
		internal Grid LayoutRoot;
		internal ClickableLayout btnViewMessages;
		internal ClickableLayout btnClearMessages;
		private bool _contentLoaded;
		public TXBlogReadPluginSetCtrl()
		{
			this.InitializeComponent();
			base.add_Loaded(new RoutedEventHandler(this.TXBlogReadPluginSetCtrl_Loaded));
		}
		public override void Exit()
		{
			base.Exit();
		}
		public void TXBlogReadPluginSetCtrl_Loaded(object sender, RoutedEventArgs e)
		{
		}
		private void btnViewMessages_Click(object sender, RoutedEventArgs e)
		{
			Account curAccount = AccountMgr.getCurAccount();
			if (curAccount.nBindQQ != 0u)
			{
				ToolFunction.GotoPageForUserControl("/Source/Plugin/TXBlogRead/UI/TXBlogReadView.xaml", null, false);
				return;
			}
			ToolFunction.GotoPageForUserControl("/Source/UI/QQFriends/GoBindQQ.xaml", null, false);
		}
		private void btnClearMessages_Click(object sender, RoutedEventArgs e)
		{
			MMMessageBox mMMessageBox = MMMessageBox.Show(strings.Plugin_ClearPluginMessage, null, true, strings.COM_Confirm, strings.COM_Cancel);
			mMMessageBox.ReturnEvent = new DlgReturnEvent(this.OnClearMsgHandler);
		}
		private void OnClearMsgHandler(DlgReturnEventArg dlgReturnEventArg_0)
		{
			switch (MMMessageBox.GetUserClickResult(dlgReturnEventArg_0))
			{
			case 0:
				BlogConversationMgr.clearAllMsg();
				break;
			case 1:
				break;
			default:
				return;
			}
		}
		[DebuggerNonUserCode]
		public void InitializeComponent()
		{
			if (this._contentLoaded)
			{
				return;
			}
			this._contentLoaded = true;
			Application.LoadComponent(this, new Uri("/MicroMsg;component/Source/Plugin/TXBlogRead/UI/TXBlogReadPluginSetCtrl.xaml", 2));
			this.LayoutRoot = (Grid)base.FindName("LayoutRoot");
			this.btnViewMessages = (ClickableLayout)base.FindName("btnViewMessages");
			this.btnClearMessages = (ClickableLayout)base.FindName("btnClearMessages");
		}
	}
}
